package ch6;

import java.util.Arrays;

public class ArrayTest3 {

	public static void main(String[] args) {
		// equals
		int[] a = { 1, 4, 5, 9 };
		int a2[] = { 1, 3, 5, 9 };
		System.out.println(Arrays.equals(a, a2));
		System.out.println(Arrays.toString(a2));

		char c[] = new char[20];
		Arrays.fill(c, 'f');
		System.out.println(Arrays.toString(c));
		// 把a2的都复制进去
		// int a3[] = new int[25];//
		// for(int i=0;i<a2.length;i++){
		// a3[i]=a2[i];
		// }
		int[] a3 = Arrays.copyOf(a2, 3);
		System.out.println(Arrays.toString(a3));
	}

}
